class shape{
    public void draw(){
        System.out.println("画图形！");
    }
}

class rect extends shape{
    @Override
    public void draw(){
        System.out.println("画矩形！！");
    }
}

class cycle extends shape{
    @Override
    public void draw(){
        System.out.println("画圆！！");
    }
}

class flower extends shape{
    @Override
    public void draw(){
        System.out.println("*！！！");
    }
}

public class test_11_14_0_2 {
    public static void drawmap(shape s){
        s.draw();
    }

    public static void drawmap2(){
        rect r=new rect();
        cycle c=new cycle();
        flower f=new flower();

        String[] shapes={"c","r","c","r","f"};
        for (String s: shapes) {
            if(s.equals("c")){
                c.draw();
            }else if(s.equals("r")){
                r.draw();
            }else{
                f.draw();
            }
        }
    }

    public static void drawmap(){
        rect r=new rect();
        cycle c=new cycle();
        flower f=new flower();

        shape[] shapes={c,r,c,r,f};
        for (shape s:shapes) {
            s.draw();
        }
    }

    public static void drawmap3(){
        shape r=new rect();
        shape c=new cycle();
        shape f=new flower();

        shape[] shapes={c,r,c,r,f};

        for (shape s:shapes) {
            s.draw();
        }
    }

    public static void main(String[] args) {
        drawmap();
        drawmap2();

        rect r=new rect();
        cycle c=new cycle();

        drawmap(r);
        drawmap(c);
        drawmap(new flower());
    }


}





